/* engcur.h -- header file for engcur.c
 *
 * Time-stamp: <2007-06-28 06:05:58 BRT Diogo F. S. Ramos>
 *
 *
 */

#ifndef ENGCUR_H
#define ENGCUR_H

#include "stdio.h"

/* Structs ***********************************************************/
/* Disciplines */
typedef struct _discipline
{
    char *cod;
    char *name;
    int credits;
    int class;
    int scheded;
    int number_of_seeds;
    struct _seed *root_seed;
    struct _discipline *next;
} discipline;

typedef struct _seed
{
    int day;
    int begin;
    int end;
    struct _seed *next;
}seed;

/* Semester */
typedef struct _semester
{
    int number_of_scheduled;
    int number_of_disciplines;
    struct _discipline *root_discipline;
}semester;


/*********************************************************************/

/* Enumarations ******************************************************/
enum
{
    SUNDAY,
    MONDAY,
    TUESDAY,
    WEDNESDAY,
    THURSDAY,
    FRIDAY,
    SATURDAY
};
/*********************************************************************/

/* Protoptypes *******************************************************/

/* Discipline */
discipline* discipline_new( char *new_cod, char *new_name, int new_cred, int new_class );
void discipline_destroy( discipline *disc );
int discipline_add_seed( discipline *disc, seed *see );
int discipline_race_seed( discipline *disc, seed *see );
int discipline_remove_seed( discipline *disc, int day, int begin, int end );
seed* discipline_get_seed( discipline *disc, int day, int begin, int end );
void discipline_print( discipline *disc );
seed* discipline_get_next_seed( discipline *disc, seed *see );

/* Seed */
seed* seed_new( int new_day, int new_begin, int new_end );
void seed_destroy( seed *see );

/* Semester */
semester* semester_new();
int semester_save_to_file( semester *sem, char *filename );
int semester_load_from_file( semester *sem, char *file_str );
int semester_add_discipline( semester *sem, discipline *disc );
int semester_remove_discipline( semester *sem, char *cod, int class );
discipline* semester_get_discipline( semester *sem, char *cod, int class );
discipline* semester_get_next_discipline( semester *sem, discipline *disc );
void semester_print( semester *sem );
int semester_schedule_add_discipline( semester *sem, discipline *disc );
int semester_schedule_remove_discipline( semester *sem, discipline *disc );
int semester_schedule_race_discipline( semester *sem, discipline *disc );
void semester_clean( semester *sem );
void semester_destroy( semester *sem );


/*********************************************************************/


#endif
